package cn.edu.cqytxy.string;

/**
 * 演示字符串的操作
 *
 * @author yinjw
 */
public class StringDemo2 {

    public static void main(String[] args) {

        String s1 = "hello world";
        String s2 = "hello world";

        System.out.println(s1 == s2); // true

        String s3 = "hello " + "world";
        System.out.println(s1 == s3); // true

        String s4 = "hello ";
        String s5 = s4 + "world";
        System.out.println(s1 == s5);

        String s6 = "hello java";
        String s7 = s6.replace("java", "world");
        System.out.println(s7 == s1);
    }
}
